package com.qf.aop;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

/**
 * @author lixu
 */
public class MyMethodInterceptor implements MethodInterceptor {
    /**
     * 环绕
     * @param methodInvocation
     * @return
     * @throws Throwable
     */
    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        System.out.println("1：===删除之前执行");
        //2:回到方法中
        Object result = methodInvocation.proceed();
        System.out.println("3:result=" + result);
        //4:回到方法中
        Object result2 = methodInvocation.proceed();
        //5:结束
        System.out.println("====结束");

        return 3;
    }
}
